<?php
$oJobs = JobHandler::getJobs();
foreach ($oJobs as $oThisJob) {
	// This used to be required for wxWidgets to behave. I think it isn't anymore.
	// $sJobName = mb_convert_encoding($oThisJob->sName, 'ASCII');
	$sJobName = $oThisJob->sName;

	print "\t<project id=\"{$oThisJob->iID}\" name=\"{$sJobName}\">\n";

	// We're not sure if we're going to use this.
	$oMissions = $oThisJob->getMissions();
	foreach ($oMissions as $oThisMission) {
		$oNotes = $oThisMission->getNotes();

		print "\t\t<task id=\"".$oThisMission->iID."\">\n";

		$sTodo = $oThisMission->sTodo;
		// This used to be required for wxWidgets to behave. I think it isn't anymore.
		// $sTodo = mb_convert_encoding($sTodo, 'ASCII');

		print "\t\t\t<todo><![CDATA[".$sTodo."]]></todo>\n";
		print "\t\t\t<status value=\"".$oThisMission->iStatus."\">".$oThisMission->iStatus."</status>\n";

		foreach ($oNotes as $oThisNote) {
			print "\t\t\t<note id=\"".$oThisNote->iID."\">\n";
			print "\t\t\t</note>\n";
		}

		print "\t\t</task>\n";
	}
	print "\t</project>\n";
}
?>
